package com.saltfish.library.servicelmp;


import com.saltfish.library.mapper.DepartmentMapper;
import com.saltfish.library.mapper.PositionMapper;
import com.saltfish.library.pojo.Department;
import com.saltfish.library.pojo.Position;
import com.saltfish.library.pojo.Staff;
import com.saltfish.library.sevice.StaffService;
import com.saltfish.library.mapper.StaffMapper;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("StaffService")
public class StaffServiceImpl implements StaffService {
    @Resource
    StaffMapper staffMapper;

    @Resource
    PositionMapper positionMapper;

    @Resource
    DepartmentMapper departmentMapper;

    @Override
    public Staff checkLogin(Staff staff) {
        return staffMapper.checkStaff(staff);
    }

    @Override
    public List<Staff> getInfos(Staff staff) {
        return staffMapper.staffOne(staff.getSid());
    }

    @Override
    public String getOne(Staff staff) {
        return staffMapper.staffSname(staff.getSid()).getSname();
    }

    @Override
    public int updataStaff(Staff staff) {
       staffMapper.updataStaff(staff);
       return 1;
    }


}
